package luj.game.robot.internal.start.listener;

import luj.cluster.api.actor.Tellable;
import luj.game.robot.api.boot.RobotStartListener;
import luj.game.robot.internal.net.http.collect.HandleMap;

import java.util.List;

final class INetworkImpl implements RobotStartListener.Network {

  @Override
  public List<RobotStartListener.Http> listHttp() {
    return _handleList.stream()
        .map(this::makeHttp)
        .toList();
  }

  private RobotStartListener.Http makeHttp(HandleMap.Handler handler) {
    var http = new INHttpImpl();
    http._handler = handler;
    http._adminRef = _adminRef;

    return http;
  }

  List<HandleMap.Handler> _handleList;

  Tellable _adminRef;
}
